<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="zh-TW"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<base href="<?php echo base_url(); ?>" />
<?php if($this->uri->segment(1) == 'post' && $this->uri->segment(2) == 'detail'){ ?>
<?php
$images = json_decode($post[0]['upload_image']);
?>
<meta property="og:type" content="article" />
<meta property="og:site_name" content="HouseMe 好俬迷"/>
<meta property="og:description" content="<?php echo strip_tags($post[0]['post_desc']); ?>"/>
<meta property="og:url" content="<?php echo current_url().'/'; ?>" />
<meta property="og:image" content="<?php echo base_url().$this->config->item('image_uploader_original','layout').'/'.$post[0]['user_id'].'/'.$images[0]; ?>" />
<meta property="og:title" content="<?php echo $post[0]['post_excerpt']; ?>" />
<meta property="fb:app_id" content="773388709361693"/>
<meta property="fb:admins" content="100004640947858"/>

<?php }elseif($this->uri->segment(1) == 'topic' && $this->uri->segment(2) == 'detail') {?>
<?php
$doc = new DOMDocument();
@$doc->loadHTML($topic[0]['topic_desc']);
$first_img = $doc->getElementsByTagName('img')->item(0);
$first_img_src = $first_img->attributes->getNamedItem("src")->value;
?>
<meta property="og:type" content="article" />
<meta property="og:site_name" content="HouseMe 好俬迷"/>
<meta property="og:description" content="<?php echo $topic[0]['topic_excerpt']; ?>"/>
<meta property="og:url" content="<?php echo current_url().'/'; ?>" />
<meta property="og:image" content="<?php echo base_url().$first_img_src ?>" />
<meta property="og:title" content="<?php echo $topic[0]['topic_title']; ?>" />
<meta property="fb:app_id" content="773388709361693"/>
<meta property="fb:admins" content="100004640947858"/>

<?php }elseif($this->uri->segment(1) == 'question' && $this->uri->segment(2) == 'show') {?>

<meta property="og:type" content="article" />
<meta property="og:site_name" content="HouseMe 好俬迷"/>
<meta property="og:description" content="<?php echo strip_tags($question[0]['desc']);?>"/>
<meta property="og:url" content="<?php echo current_url().'/'; ?>" />
<meta property="og:image" content="<?php echo base_url().$this->config->item('image_uploader_question_vote_original', 'layout').$question[0]['uid'].'/'.$votes[0]['image']; ?>" />
<meta property="og:title" content="<?php echo $question[0]['title'];?>" />
<meta property="fb:app_id" content="773388709361693"/>
<meta property="fb:admins" content="100004640947858"/>


<?php }else{ ?>

<meta property="og:site_name" content="HouseMe 好俬迷"/>
<meta property="og:description" content="一群非專業的人，喜歡蒐集討論有味道的傢俬及佈置，期待小小的一個巧思就可以改變整個居家氛圍。我們相信擁有一個美好的家，不一定需要很多錢跟很大的空間。最重要的是靈感/想法以及願意改變的動機。好俬迷希望可以成為一個大家互相交流靈感/想法/資源的平台，讓擁有美好居家生活不再只是遙不可及的夢想。"/>
<meta property="og:url" content="<?php echo current_url(); ?>" />
<meta property="og:image" content="<?php echo base_url().'assets/img/head/logo.png' ?>" />
<meta property="og:title" content="HouseMe 好俬迷" />
<meta property="fb:app_id" content="773388709361693"/>
<?php } ?>

<title>HouseMe--好俬迷</title>
<link rel="shortcut icon" href="/favicon.ico"/>
<link href="/assets/css/houseme.css" rel="stylesheet" type="text/css" />

<!---->
<script type="text/javascript" src="/assets/scripts/frontend/jquery-1.8.3.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/jquery-ui-1.10.3.min.js"></script>

<!--greensock-->
<script type="text/javascript" src="/assets/scripts/frontend/TweenMax.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/TimelineLite.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/TimelineMax.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/easing/EasePack.min.js"></script>
<!---->
<script type="text/javascript" src="/assets/scripts/frontend/jquery.isotope.pkgd.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/jquery.imagesloaded.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/jquery.masonry-horizontal.js"></script>
<script type="text/javascript" src="/assets/plugins/jquery-cycle2/jquery.cycle2.min.js"></script>
<script type="text/javascript" src="/assets/plugins/jquery-cycle2/jquery.cycle2.swipe.min.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/houseme.js"></script>
<script type="text/javascript" src="/assets/scripts/frontend/jquery.form.js"></script>
<?php if($this->uri->segment(1) == 'question' && $this->uri->segment(2) == 'show'){ ?>
<script type="text/javascript" src="/assets/plugins/fancybox/source/jquery.fancybox.pack.js"></script>
<link href="/assets/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    jQuery(document).ready(function() {
    
        $("a.thumb_images").fancybox({
            'titleShow'     : false
        });
    });
</script>
<?php } ?>
<!--FB plugin-->
<script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/zh_TW/sdk.js#xfbml=1&appId=773388709361693&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
<!--FB plugin-->
<script type="text/javascript" src="/assets/scripts/frontend/mobile.js"></script>
<!--bootstrap-->
<!-- 最後編譯與最小化CSS -->
<link rel="stylesheet" href="/assets/css/bootstrap.min.css">

<!-- 選擇項主題樣式 -->
<link rel="stylesheet" href="/assets/css/bootstrap-theme.min.css">
<!-- 最後編譯與最小化JavaScript -->
<script src="/assets/scripts/frontend/bootstrap.min.js"></script>
<!--bootstrap-->
                    




<?php if($this->uri->segment(1)!='category'){ ?>
<script type="text/javascript" src="/assets/scripts/frontend/waterfall.js"></script>
<?php } ?>

</head>

<body>
    <!--FB plugin-->
    <div id="fb-root"></div>
    <!--FB plugin-->
<div id="wrapper">
    <!--Logo-->
    <h1 class="logo hidden-xs hidden-sm"><a href="/">HouseMe 好俬迷</a></h1>
    <div id="brushBlack">&nbsp;</div>
	<!--Menu-->
	<div id="menu">
        
    	<div id="search" class="hidden-xs hidden-sm">
            <form action="houseme/search" method="GET" id="search_form" onsubmit="encodeSearchFormInput(this)">
                <input type="text" class="searchInputBox" name="q" id="search_query" onblur="if(this.value=='') this.value='請輸入您想搜尋的主題';" onfocus="if(this.value=='請輸入您想搜尋的主題') this.value='';" value="<?php echo isset($keyword)?$keyword:'請輸入您想搜尋的主題'; ?>" />
                <div class="searchBtn"><a href="javascript:if(document.getElementById('search_query').value=='' || document.getElementById('search_query').value=='請輸入您想搜尋的主題'){alert('請輸入您想搜尋的主題');}else{document.getElementById('search_form').submit();}">搜尋</a></div>    
            </form>
        </div>
        <div class="btn_menu visible-xs visible-sm">
            <a href="#">
                <img src="/assets/img/m_btn.png" alt="">
            </a>
        </div>
        <div id="nav" class="hidden-xs hidden-sm">
        <ul>
        	<li class="navBtn01"><a href="http://houseme.meepshop.com/" target="_blank">好巧俬</a></li>
            <?php if($this->uri->segment(1)=='topics'){ ?>
                <li class="navBtn02Selected"><a href="topics">俬主題</a></li>
            <?php }else{ ?>
                <li class="navBtn02"><a href="topics">俬主題</a></li>
            <?php } ?>
        </ul>
        </div>
        <div id="logIn">
        	<!--<div class="logBtnFb"><a href="/houseme/FBlogin">FB登入</a></div>-->
            <!--<div class="logBtnEmail"><a href="#">E-mail登入</a></div>-->
            <?php echo $login_area; ?>
        </div>
    </div>
    <!--menu-->
        <div class="menu visible-xs visible-sm">
            <div class="menucontent">
                <div class="serch">
                    <form action="houseme/search" method="GET" id="m_search_form" onsubmit="encodeSearchFormInput(this)">
                        <input type="text" name="q" id="m_search_query" onblur="if(this.value=='') this.value='請輸入您想搜尋的主題';" onfocus="if(this.value=='請輸入您想搜尋的主題') this.value='';" value="<?php echo isset($keyword)?$keyword:'請輸入您想搜尋的主題'; ?>" />
                    </form>
                    <div class="btn_serch">
                        <a href="javascript:if(document.getElementById('m_search_query').value=='' || document.getElementById('m_search_query').value=='請輸入您想搜尋的主題'){alert('請輸入您想搜尋的主題');}else{document.getElementById('m_search_form').submit();}"><img src="/assets/img/btn_serch.png" alt=""></a>
                    </div>
                    <div class="c"></div>
                </div>
                <dl>
                    <dt class="m01 myTag">
                        <a href="#">
                            <img src="/assets/img/m01.png" alt="">
                        </a>
                    </dt>
                    <?php 

                    foreach ($category as $key => $value) {
                    ?>
                        <dd><a href="/category/show/<?php echo $key; ?>"><?php echo $value; ?></a></dd>
                    <?php
                        }
                    ?>
                </dl>
            </div>
        </div>
    <div class="kv visible-xs visible-sm">
        <a href="/">
            <div class="content">
                <div class="logo">
                    <img src="/assets/img/kv.jpg" alt="">
                </div>
            </div>
        </a>
    </div>
    <div class="submenu visible-xs visible-sm">
            <ul>
                <li>
                    <a href="http://houseme.meepshop.com/" target="_blank">
                        <img src="/assets/img/sm01.png" alt="">
                    </a>
                </li>
                <li>
                <?php if($this->uri->segment(1)=='topics'){ ?>
                    <a id="select" href="topics">
                        <img src="/assets/img/sm02.png" alt="">
                    </a>
                <?php }else{ ?>
                    <a href="topics">
                        <img src="/assets/img/sm02.png" alt="">
                    </a>
                <?php } ?>
                </li>
                <!--
                <li>
                    <a href="list_share.html">
                        <img src="/assets/img/sm03.png" alt="">
                    </a>
                </li>
                -->
            </ul>
        </div>
    
    <!--add collect box-->
    <div id="collectBox"></div>
    <!--add edit collect box-->
    <div id="editCollectBox"></div>
    <!-- edit user info box-->
    <div id="editUserInfoBox"></div>
    <!--upload idea box-->
    <div id="uploadIdeaBox"></div>
    <!--add login box-->
    <div id="loginBox"></div>
    <!--add login first box-->
    <div id="loginFirstBox"></div>

    <!--Menu Tag各類別選單-->
    <div id="navTag" class="hidden-xs hidden-sm">
    	<div class="myTag"><a href="#">我的收藏</a></div>
        <div class="tagListTopline"></div>
        <ul>
            <?php 
            $selectedCategory = '';
            if($this->uri->segment(1) == 'category' && $this->uri->segment(2) == 'show'){ 
                $selectedCategory = $this->uri->segment(3);
            }
            elseif(isset($category_id)){
                $selectedCategory = $category_id;
            }
            ?>
            <?php 

            foreach ($category as $key => $value) {
            ?>
            <?php if($selectedCategory == $key){ ?>
        	   <li class="selectedCategory"><a href="/category/show/<?php echo $key; ?>"><?php echo $value; ?></a></li>
            <?php }else{ ?>
                <li><a href="/category/show/<?php echo $key; ?>"><?php echo $value; ?></a></li>
            <?php } ?>
            <?php
                }
            ?>
        </ul>
	</div>